package doantotnghiep.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="LoSanPham")
public class MedicamentBatch {

	private int id;
	private String expirationDate;
	private String dateOfManufacture;
	private String addedDate;
	private String batchIdentifyNumber;
	private ImportedDetail importDetail;
	
	private int status;
	
	@Id
	@GeneratedValue
	@Column(name = "MaLH")
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	@Column(name = "NgayHetHan")
	public String getExpirationDate() {
		return expirationDate;
	}
	
	public void setExpirationDate(String expirationDate) {
		this.expirationDate = expirationDate;
	}
	
	@Column(name = "NgaySanXuat")
	public String getDateOfManufacture() {
		return dateOfManufacture;
	}
	
	public void setDateOfManufacture(String dateOfManufacture) {
		this.dateOfManufacture = dateOfManufacture;
	}
	
	@Column(name = "NgayNhapKho")
	public String getAddedDate() {
		return addedDate;
	}
	
	public void setAddedDate(String addedDate) {
		this.addedDate = addedDate;
	}
	
	private Medicament medicament;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "MaSP")
	public Medicament getMedicament() {
		return medicament;
	}

	public void setMedicament(Medicament medicament) {
		this.medicament = medicament;
	}
	
	private Cabinet cabinet;
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "MaTu")
	public Cabinet getCabinet() {
		return cabinet;
	}

	public void setCabinet(Cabinet cabinet) {
		this.cabinet = cabinet;
	}
	
	@Column(name="SoHieuLo")
	public String getBatchIdentifyNumber() {
		return batchIdentifyNumber;
	}

	public void setBatchIdentifyNumber(String batchIdentifyNumber) {
		this.batchIdentifyNumber = batchIdentifyNumber;
	}
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "MaCTN")
	public ImportedDetail getImportDetail() {
		return importDetail;
	}

	public void setImportDetail(ImportedDetail importDetail) {
		this.importDetail = importDetail;
	}

	@Column(name= "DaBan")
	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}
}
